package com.example.demo.DAO;

import com.example.demo.DO.OrderDO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDAO {
    @Select("select distinct * from order1 where user=#{user}")
    public List<OrderDO> selectId(String user);
    @Select("select sum(totalPeice) from order1 where user=#{user}")
    public Double selectTotal(String user);
    @Select("select * from  order1 ")
    public List<OrderDO> selectAll();
    @Insert("insert into order1 value (#{user},#{aucId},#{totalPrice})")
    public int insert_order(String user,String aucId,Double totalPrice);
    @Delete("delete from order1 where aucId=#{aucId}")
    public int delete(String aucId);
    @Delete("delete from order1 where aucId=#{aucId} and user=#{user}")
    public int delete_user(String aucId,String user);
}
